import os

def writeFile(filename, content):
    """
    文件写入工具
    """
    os.makedirs(os.path.dirname(filename), exist_ok=True)
    with open(filename, 'w', encoding='utf-8') as f:
        f.write(content)

def clean_dir(dir):
    """
    清空目录
    """
    if os.path.exists(dir):
        for file in os.listdir(dir):
            print(f"删除文件：{file}")
            os.remove(os.path.join(dir, file))